package com.rush.springbootinit.constant;

/**
 * redis 常量
 */
public interface RedissonConstant {
    /**
     * 用户签到记录的key前缀
     */
    String USER_SIGN_IN_RECORD_KEY_PREFIX = "user:sign";

    /**
     * 获取签到用户记录的redis key
     * @param year
     * @param userId
     * @return 拼接好的redisKey
     */
    static String getUserSignInRecordKey(int year, Long userId){
        return String.format("%s:%d:%d", USER_SIGN_IN_RECORD_KEY_PREFIX, year, userId);
    }
}
